GATE IT 2006
Q41.
For the set N of natural numbers and a binary operation f : N \times N \to N, an element z \in N is called an identity for f, if f (a, z) = a = f(z, a), for all a \in N. Which of the following binary operations have an identity? i. f (x, y) = x + y - 3 ii. f (x, y) = \max(x, y) iii. f (x, y) = x^yQ42.
What is the cardinality of the set of integers X defined below? X=\{n \mid 1 \leq n \leq 123, n is not divisible by either 2, 3 or 5}Q43.
Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars relation are did and cid respectively and the records are stored in ascending order of these primary keys as given in the tables. No indexing is available in the database. \overset{\text{D: Drivers relation}}{\begin{array}{|c|l|r|c|}\hline \textbf{did}& \textbf{dname}& \textbf{rating}& \textbf{age} \\\hline 22& \text{Karthikeyan}& 7& 25 \\ \hline 29& \text{Salman}& 1& 33 \\ \hline 31& \text{Boris}& 8& 55 \\\hline 32& \text{Amoldt}& 8& 25 \\\hline 58& \text{Schumacher}& 10& 35 \\\hline 64& \text{Sachin}& 7& 35 \\\hline 71& \text{Senna}& 10& 16 \\\hline 74& \text{Sachin}& 9& 35 \\\hline 85& \text{Rahul}& 3& 25 \\\hline 95& \text{Ralph}& 3& 53 \\\hline \end{array}} \qquad \overset{\text{R: Reserves relation}}{\begin{array}{|c|c|c|}\hline \textbf {did} & \textbf {Cid} & \textbf {day} \\\hline 22 & 101 & 10-10-06 \\ \hline 22 & 102 & 10-10-06\\ \hline 22 & 103 & 08-10-06 \\\hline 22 & 104 & 07-10-06 \\\hline 31 & 102 & 10-11-16 \\\hline 31&103 &06-11-16 \\\hline 31 & 104&12-11-16 \\\hline 64 & 101 &05-09-06 \\\hline 64& 102 & 08-09-06 \\\hline 74 & 103 & 08-09-06 \\\hline \end{array}} \overset{\text{C: Cars relation}}{\begin{array}{|c|c|c|c|}\hline \textbf {Cid} & \textbf {Cname} & \textbf{colour} \\\hline 101 & \text{Renault} & \text{blue} \\ \hline 102 & \text{Renault} & \text{red} \\ \hline 103 & \text{Ferrari} & \text{green} \\\hline 104 & \text{Jaguar} & \text{red} \\\hline \end{array}} select D.dname from Drivers D where D.did in ( select R.did from Cars C, Reserves R where R.cid = C.cid and C.colour = 'red' intersect select R.did from Cars C, Reserves R where R.cid = C.cid and C.colour = 'green' ) Let n be the number of comparisons performed when the above SQL query is optimally executed. If linear search is used to locate a tuple in a relation using primary key, then n lies in the range:Q44.
Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars relation are did and cid respectively and the records are stored in ascending order of these primary keys as given in the tables. No indexing is available in the database. \overset{\text{D: Drivers relation}}{\begin{array}{|c|l|r|c|}\hline \textbf{did}& \textbf{dname}& \textbf{rating}& \textbf{age} \\\hline 22& \text{Karthikeyan}& 7& 25 \\ \hline 29& \text{Salman}& 1& 33 \\ \hline 31& \text{Boris}& 8& 55 \\\hline 32& \text{Amoldt}& 8& 25 \\\hline 58& \text{Schumacher}& 10& 35 \\\hline 64& \text{Sachin}& 7& 35 \\\hline 71& \text{Senna}& 10& 16 \\\hline 74& \text{Sachin}& 9& 35 \\\hline 85& \text{Rahul}& 3& 25 \\\hline 95& \text{Ralph}& 3& 53 \\\hline \end{array}} \qquad \overset{\text{R: Reserves relation}}{\begin{array}{|c|c|c|}\hline \textbf {did} & \textbf {Cid} & \textbf {day} \\\hline 22 & 101 & 10-10-06 \\ \hline 22 & 102 & 10-10-06\\ \hline 22 & 103 & 08-10-06 \\\hline 22 & 104 & 07-10-06 \\\hline 31 & 102 & 10-11-16 \\\hline 31&103 &06-11-16 \\\hline 31 & 104&12-11-16 \\\hline 64 & 101 &05-09-06 \\\hline 64& 102 & 08-09-06 \\\hline 74 & 103 & 08-09-06 \\\hline \end{array}} \overset{\text{C: Cars relation}}{\begin{array}{|c|c|c|c|}\hline \textbf {Cid} & \textbf {Cname} & \textbf{colour} \\\hline 101 & \text{Renault} & \text{blue} \\ \hline 102 & \text{Renault} & \text{red} \\ \hline 103 & \text{Ferrari} & \text{green} \\\hline 104 & \text{Jaguar} & \text{red} \\\hline \end{array}} What is the output of the following SQL query? select D.dname from Drivers D where D.did in ( select R.did from Cars C, Reserves R where R.cid = C.cid and C.colour = 'red' intersect select R.did from Cars C, Reserves R where R.cid = C.cid and C.colour = 'green' )Q45.
A program on machine X attempts to open a UDP connection to port 5376 on a machine Y, and a TCP connection to port 8632 on machine Z. However, there are no applications listening at the corresponding ports on Y and Z. An ICMP Port Unreachable error will be generated byQ46.
Which of the following relational query languages have the same expressive power? I. Relational algebra II. Tuple relational calculus restricted to safe expressions III. Domain relational calculus restricted to safe expressions